﻿using System;
using System.Collections.Generic;
using System.Text;
using UMLDesigner.Widgets;

namespace UMLDesigner.WorkUnits
{
    class NewWidgetWorkUnit : IWorkUnit
    {
        public NewWidgetWorkUnit(UMLWidget addedItem)
        {
            item = addedItem;
        }

        private UMLWidget item = null;

        public void Do(Document doc)
        {
            doc.AddWidget(item);
            doc.IsModified = true;
        }

        public void Undo(Document doc)
        {
            doc.RemoveWidget(item);
            doc.IsModified = true;
        }
    }
}
